package com.icloud.common.core.constant;

/**
 * 权限相关常量定义
 * Created by im on 2020/6/19.
 */
public interface AuthConstant {

    /**
     * JWT存储权限前缀
     */
    String AUTHORITY_PREFIX = "ROLE_";

    /**
     * JWT存储权限属性
     */
    String AUTHORITY_CLAIM_NAME = "authorities";

    /**
     * 后台client_id
     */
    String ADMIN_CLIENT_ID = "admin";

    /**
     * app client_id
     */
    String APP_CLIENT_ID = "app";

    /**
     * 内部调用接口(feign)路径匹配
     */
    String INTERNAL_URL_PATTERN = "/internal/**";

    /**
     * 后台管理接口路径匹配
     */
    String ADMIN_URL_PATTERN = "/**/admin/**";

    /**
     * app接口路径匹配
     */
    String APP_URL_PATTERN = "/**/app/**";

    /**
     * Redis缓存权限规则key
     */
    String RESOURCE_ROLES_MAP_KEY = "auth:resourceRolesMap";

    /**
     * 认证信息Http请求头
     */
    String JWT_TOKEN_HEADER = "Authorization";

    /**
     * JWT令牌前缀
     */
    String JWT_TOKEN_PREFIX = "Bearer ";

    /**
     * 用户信息Http请求头
     */
    String USER_TOKEN_HEADER = "user";
    /**
     * 客户信息Http请求头
     */
    String CUSTOMER_TOKEN_HEADER = "customer";

    /**
     * JWT 客户端密钥
     */
    String CLIENT_SECRET = "ZS%z01YtcfYfF7!M";

    /**
     * Redis缓存Token规则key
     */
    String RESOURCE_TOKEN_KEY = "auth:tokenSet";
}
